<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

if(!defined('TinyFW')) exit('Access denied!');

class tfSession {

    private static $instance = null;
    //private static $session = null;

    public function __clone() {}
    private function __construct() {
        //self::$session = $_SESSION;
    }

    public static function singleton() {
        if(!isset (self::$instance)) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    public static function register($key, $value) {
        session_register($key, $value);
    }

    public static function getSessionId() {
        return session_id();
    }

    public static function unregister($key) {
        session_unregister($key);
    }

    public static function get($key) {
        if(isset($_SESSION[$key])) {
            return $_SESSION[$key];
        }
        return null;
    }


}

?>
